import 'package:learning_content_admin_pannel.core/logger/log_level.dart';

part 'environment.dart';

const _kApiVersion = 'v1';

class Config {
  factory Config() {
    return _instance;
  }

  Config._internal();

  static final _instance = Config._internal();

  late final LogLevel logLevel;
  late final Environment environment;

  late final String serverBaseUrl;
  late final String serverApiBaseUrl;

  Future<void> initDev() async {
    logLevel = LogLevel.verbose;
    environment = Environment.dev;

    serverBaseUrl = 'https://stage.angrywords.ru';
    serverApiBaseUrl = '$serverBaseUrl/api/$_kApiVersion';
  }

  /////////////////////////////////////////////////////////////////////////////////////////////////
  // PRODUCTION CONFIG
  /////////////////////////////////////////////////////////////////////////////////////////////////
  // <editor-fold defaultstate="collapsed">

  Future<void> initProd() async {
    logLevel = LogLevel.info;
    environment = Environment.prod;

    serverBaseUrl = 'https://angrywords.ru';
    serverApiBaseUrl = '$serverBaseUrl/api/$_kApiVersion';
  }

// </editor-fold>
}
